﻿//----------------------------------------------------------------
// <copyright file="ErrorRsp.cs" >
//    Top Do ---TOP API DEMO 示例系列之
//    CLR Version: 2.0.50727.1434
//    NameSpace:  TopSpace.Bll
//    FileClass: ErrorRsp - API接口调用错误消息类
//
//    By 淘宝旺旺ID: 幻影时空
//    Email:visionspace@st-soft.cn
//    Copyright (C) SpaceTime SoftWare , All rights reserved (www.st-soft.cn).
//
//    项目引用 System.Net 类
// </copyright>
//----------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;

namespace TopSpace.Bll
{
    /// <summary>
    /// 错误消息结构
    /// </summary>
    public class ErrorRsp
    {
        /*
         *
         *  ---api2.0 错误代码格式-----
         *
         * 错误代码详见：http://open.taobao.com/dev/index.php/%E9%94%99%E8%AF%AF%E7%A0%81%E4%B8%80%E8%A7%88%E8%A1%A8
         * 
<error_response>
<args list="true"><arg><key></key><value></value></arg></args>
<code></code>
<msg></msg>
<sub_code></sub_code>
<sub_msg></sub_msg>
</error_response>
         * 
         */

        private bool _isError = false;
        /// <summary>
        /// 是否错误
        /// </summary>
        public bool IsError
        {
            set { _isError = value; }
            get { return _isError; }
        }

        private string _args = string.Empty;
        /// <summary>
        /// 请求错误参数 (API1.0 error_rsp/args/arg[name]|arg.Text | API2.0 error_response/args/arg)
        /// </summary>
        public string args
        {
            set { _args = value; }
            get { return _args; }
        }
        private string _code = string.Empty;
        /// <summary>
        /// 错误代码 (API1.0 error_rsp/code.Text | API2.0 error_response/code)
        /// </summary>
        public string code
        {
            set { _code = value; }
            get { return _code; }
        }

        private string _msg = string.Empty;
        /// <summary>
        /// 错误消息 (API1.0 error_rsp/msg.Text | API2.0 error_response/msg)
        /// </summary>
        public string msg
        {
            set { _msg = value; }
            get { return _msg; }
        }

        private string _sub_code = string.Empty;
        /// <summary>
        /// 子错误代码 (API2.0 error_response/sub_code)
        /// </summary>
        public string sub_code
        {
            set { _sub_code = value; }
            get { return _sub_code; }
        }

        private string _sub_msg = string.Empty;
        /// <summary>
        /// 子错误消息 (API2.0 error_response/sub_msg)
        /// </summary>
        public string sub_msg
        {
            set { _sub_msg = value; }
            get { return _sub_msg; }
        }

        private string _depict = string.Empty;
        /// <summary>
        /// 错误消息 转换后的文本
        /// </summary>
        public string depict
        {
            set { _depict = value; }
            get { return _depict; }
        }
    }
}
